<template>
  <div>
    <h1>医师列表</h1>
    <el-table v-loading="loading" :data="doctorList">
      <el-table-column label="医生id" prop="doctorId" width="120"/>
      <el-table-column label="医生名称" prop="doctorName" :show-overflow-tooltip="true" width="150"/>
      <el-table-column label="年限" prop="age" :show-overflow-tooltip="true" width="150"/>
      <el-table-column label="医师资格证书" prop="doctorQualificationCertificate" :show-overflow-tooltip="true" width="150"/>
      <el-table-column label="医师职业证书" prop="doctorOccupationCertificate" :show-overflow-tooltip="true" width="150"/>
      <el-table-column label="问诊次数" prop="inquiryCount" :show-overflow-tooltip="true" width="150"/>
      <el-table-column label="总收入金额" prop="incomeCost" :show-overflow-tooltip="true" width="150"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click=""
          >进入
          </el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）,
//例如：import 《组件名称》 from '《组件路径》,
import {doctorList} from "@/api/manage/doctor";

export default {
  //import引入的组件需要注入到对象中才能使用"
  components: {},
  props: {},
  data() {
    //这里存放数据"

    return {
      doctorList:[],
      loading:true,
      getDoctorReq:{
        pageNum:1,
        pageSize:5,
        name:"",
        doctorTypeId:null,
        departmentId:null,
        hospitalId: null,
        total:null
      }
    };
  },
  //计算属性 类似于data概念",
  computed: {},
  //监控data中的数据变化",
  watch: {},
  //方法集合",
  methods: {
    getDoctorTypeList() {
      doctorList(this.getDoctorReq).then(res=>{
        this.getDoctorReq.pageNum = res.data.pageNum;
        this.getDoctorReq.pageSize = res.data.pageSize;
        this.getDoctorReq.total = res.data.total;
        this.doctorList = res.data.list;
        this.loading=false;
      })
    }
  },
  //生命周期 - 创建完成（可以访问当前this实例）",
  created() {
    this.getDoctorReq.departmentId = this.$route.query.departmentId;
    this.getDoctorReq.hospitalId = this.$route.query.hospitalId;
    this.getDoctorReq.doctorTypeId=this.$route.query.doctorTypeId;
    this.getDoctorTypeList();
  },
  //生命周期 - 挂载完成（可以访问DOM元素）",
  mounted() {
  },
  beforeCreate() {
  }, //生命周期 - 创建之前",
  beforeMount() {
  }, //生命周期 - 挂载之前",
  beforeUpdate() {
  }, //生命周期 - 更新之前",
  updated() {
  }, //生命周期 - 更新之后",
  beforeDestroy() {
  }, //生命周期 - 销毁之前",
  destroyed() {
  }, //生命周期 - 销毁完成",
  activated() {
  } //如果页面有keep-alive缓存功能，这个函数会触发",
};
</script>
<style scoped>

</style>
